<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{/public :: #public_head}"></head>
<body>
<div class="container">
    <div th:replace="~{/public :: #public_header}"></div>
    <div th:replace="~{/public :: #public_time}"></div>
    <div class="main">
        <div th:replace="~{/public :: #public_left(activeUri='article')}"></div>
        <div class="right">
            <div class="search">
                <form th:action="@{/admin/article/like}" method="post">
                    <span>是否有效：</span>
                    <select name="active">
                        <option value="">--请选择--</option>
                        <option th:value="1" th:text="有效" ></option>
                        <option th:value="0" th:text="无效" ></option>
                    </select>
                    <span>发布状态：</span>
                    <select name="state">
                        <option value="">--请选择--</option>
                        <option th:value="已发布" th:text="已发布" ></option>
                        <option th:value="草稿" th:text="未发布" ></option>
                    </select>
                    <span>文章作者：</span>
                    <select name="id">
                        <option value="">--请选择--</option>
                        <option th:each="user:${users}" th:value="${user.id}" th:text="${user.nickname}"></option>
                    </select>
                    <button type="submit">查询</button>
                </form>
            </div>
            <table class="table-list">
                <tr class="tr-first">
                <th>标题</th>
                <th>作者</th>
                <th>发布状态</th>
                <th>创建时间</th>
                <th>更新时间</th>
                <th>是否有效</th>
                <th>操作</th>
                </tr>
                <tr th:each="article:${articles}" class="tr-list">
                    <td th:text="${article.title}"></td>
                    <td th:text="${article.createUserName}"></td>
                    <td th:text="${article.state}"></td>
                    <td th:text="${#temporals.format(article.createTime, 'yyyy-MM-dd hh:MM:SS')}"></td>
                    <td th:text="${#temporals.format(article.updateTime, 'yyyy-MM-dd hh:MM:SS')}"></td>
                    <td th:text="${article.active == 1 ? '是' : '否'}">是</td>
                    <td>
                        <a th:href="@{/admin/article/} + ${article.id}" class="a-edit">查看</a>
                        <a th:attr="rev_uri=@{/admin/article/revoke/} + ${article.id}" class="revoke">启用</a>
                        <a th:attr="del_uri=@{/admin/article/delete/} + ${article.id}" href="#" class="delete">删除</a>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <!--点击删除按钮后弹出的页面-->
    <div class="zhezhao"></div>
    <div th:replace="~{/public :: #public_deleteForm}"></div>
    <div th:replace="~{/public :: #public_revokeForm}"></div>
    <div th:replace="~{/public :: #public_footer}"></div>
</div>
</body>
</html>